import { ResPage, Role } from "@/api/interface/index";

import http from "@/api";

/**
 * @name 角色管理模块
 */
// * 获取角色列表
export const getRoleList = (params: Role.ReqGetRoleParams) => {
	return http.post<ResPage<Role.ResRoleList>>("/system/role/list", params);
};

// * 新增角色
export const addRole = (params: { id: string }) => {
	return http.post("/system/role/add", params);
};

// * 编辑角色
export const editRole = (params: { id: string }) => {
	return http.post("/system/role/edit", params);
};

// * 删除角色
export const deleteRole = (params: { id: string[] }) => {
	return http.post("/system/role/delete", params);
};

// * 切换角色状态
export const changeRoleStatus = (params: { id: string; status: number }) => {
	return http.post("/system/role/changeStatus", params);
};
